#require 'find'
#dirlist = ['bin', 'sbin']
#Find.find(dirlist) do |file|
#  puts file
#end

require 'digest/md5'
require 'find'
dirs = ["/Users/saf/", "/etc"]
excludes = ["CVS","classes","images","lib","tlds"]
for dir in dirs
  Find.find(dir) do |path|
    if FileTest.directory?(path)
      if excludes.include?(File.basename(path))
        Find.prune       # Don't look any further into this directory.
      else
        next
      end
    else
      #--- delete this if things bork ---#
      p "MD5 sum path here"
      digest = Digest::MD5.hexdigest(path)
      puts digest
      File.open("testout.txt", "a") { |f|
         f << path
         f << "\n"
         f << digest
         f << "\n"
         #f << Time.new.to_s
         f << "\n"
       }
      #---         end delete         ---#
      p path
    end
  end
end